package com.ftwj.mapper;

import com.ftwj.entity.SchoolPlaceInfo;
import com.ftwj.entity.SchoolRoomSeatInfo;
import com.ftwj.entity.UserAppointmentInfo;
import com.ftwj.vo.UserAppointmentVO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

public interface HomePageMapper {
    List<SchoolRoomSeatInfo> getSeatsByPlaceId(String placeId);
    List<SchoolPlaceInfo> getAllPlaces();
    /**
     * 根据场所ID获取已预约的座位数量
     *
     * @param placeId 场所ID
     * @return 已预约座位的数量
     */

    Integer getReservedSeatsCountByPlaceId(String placeId);

    /**
     * 根据场所ID获取所有已预约的座位信息
     *
     * @param placeId 场所ID
     * @return 已预约座位的信息列表
     */
    List<UserAppointmentInfo> getReservedSeatsByPlaceId(String placeId);
    //获取过去15天内每个场所的预约次数
    @MapKey("placeId")
    List<Map<String, Object>> countAppointmentsByPlaceAndDayInLast15Days(@Param("startDate") LocalDate startDate);

    List<UserAppointmentVO> getAppointmentDetails();
}
